﻿
<link href="~/Scripts/jquery-easyui-extensions/textbox/jeasyui.extensions.textbox.css" rel="stylesheet" />
<script src="~/Scripts/jquery-easyui-extensions/linkbutton/jeasyui.extensions.linkbutton.setText.js"></script>
<script src="~/Scripts/jquery-easyui-extensions/textbox/jeasyui.extensions.textbox.setButtonText.js"></script>

<div class="easyui-panel" data-options="fit:true,border:false" style="padding:20px;">
    <input id="btnTarget" type="text" class="easyui-textbox" value="" data-options="buttonText: '保存',buttonIcon:'icon-save',iconCls: 'icon-search',iconAlign: 'left'" />
    <br /><br /><br /><br />
    <input id="textValue" type="text" value="确定" /> &nbsp;<span style="color:red;">请自行输入要设置给上述 textbox 的按钮图标文本</span>
    <br />
    <a id="btnSet" class="easyui-linkbutton" data-options="iconCls:'icon-edit'">设置新的按钮文本</a>
</div>

<script>
    $(function () {

        $("#btnSet").click(function () {
            var value = $("#textValue").val();
            if ($.string.isNullOrWhiteSpace(value)) { return; }

            $("#btnTarget").textbox("setButtonText", value);
        });

    });
</script>